<template>
  <header v-show="header.visible" class="header">
    <span class="title">{{ header.title }}</span>
    <div class="operate">
      <span class="search">
          <svg-icon class="icon" name="search" color="rgb(62, 62, 64)" />
      </span>
      <span class="more"> 
          <svg-icon class="icon" name="more" color="rgb(62, 62, 64)" />
      </span>
    </div>
  </header>
</template>

<script>
import { mapState } from "vuex";
import SvgIcon from './SvgIcon.vue';
export default {
  components: { SvgIcon },
  name: "top-header",
  computed: {
    ...mapState(["header"]),
  },
};
</script>

<style scoped>
.icon {
    height: 100%;
    width: 100%;
}
.header {
  height: 64px;
  width: 100%;
  background-color: rgb(244, 245, 246);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.header > .title {
    position: absolute;
}
.header > .operate {
    margin: auto 0 auto auto;
    display: flex;
    height: 100%;
    align-items: center;
}
.header > .operate > span {
    margin-right: 14px;
}
.header > .operate > .more {
    height: 20px;
    width: 20px;
}
.header > .operate > .search {
    height: 24px;
    width: 24px;
}

</style>